package com.tgy.leetcode;

/**
 *
 *  https://leetcode-cn.com/problems/toeplitz-matrix/
 */
public class _766_托普利茨矩阵_01 {

    public static boolean isToeplitzMatrix(int[][] matrix) {

        int row = matrix.length;
        int col = matrix[0].length;

        for (int i = 1; i < row; i++) {

            for (int j = 1; j < col; j++) {

                if (matrix[i - 1][j - 1] != matrix[i][j]) {

                    return false;
                }
            }
        }

        return true;
    }

    public static void main(String[] args) {

        int[][] nums = {
                        {1,2,3,4},
                        {5,1,2,3},
                        {9,5,1,2}
                    };
        System.out.println(isToeplitzMatrix(nums));
    }
}
